import yaml


def read_yaml(filename):
    # 读取yaml文件  with语句：不需要手动关闭，会自动关闭打开的文件
    with open(filename, encoding="utf-8") as f:
        # safe_load() 安全加载  读取  data是个字典
        data = yaml.safe_load(f)
        return data


